{include file="public/meat" title="网站核心设置"/}
<div class="cx-fex-c">
    <div class="x11 pad-t15 pad-b10">
        <div class="cx-fex-c">
            <div class="layout">
                {include file="config/head" /}
            </div>
        </div>
    </div>
    <div class="x11">
        <fieldset class="cx-field">
            <legend class="cx-field-legend">网站核心设置</legend>
            <form class="layui-form" role="form" action="" method="post">
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">网站名称 <span class="t-red">*</span> </label>
                    </div>
                    <div class="xs8 xl9">
                        <input class="ipt" placeholder="请输入网站名称" name="webdb[webname]" required="" type="text" value="{$webdb.webname|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">网站关键词 <span class="t-red">*</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <input class="ipt" placeholder="请输入网站关键词" name="webdb[webkeywords]" required="" type="text" value="{$webdb.webkeywords|default=''}">
                        <span class="c-999">多个关键词请用“,”进行分割！</span>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">网站描述 <span class="t-red">*</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <textarea class="ipt" rows="3" placeholder="请输入网站描述" name="webdb[description]">{$webdb.description|default=''}</textarea>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">LOGO </label>
                    </div>
                    <div class="xs8 xl9">
                        <img id="logo-yl" src="{if $webdb.weblogo}/{$webdb.updir}/{$webdb.weblogo}{/if}" onerror="this.src='__ADMIN__/imgnone.png'" height="60" width="auto">
                        <span id="logo-text"></span>
                        <a class="button button-S bg-green uploadbtn" data-imgu="#logo-yl" data-err="#logo-text" data-vals="#weblogo" data-dels="#dellogo" lay-data="{method:'post',accept:'images',data:'img',field:'picurl'}"><i class="cx-icon cx-icon-shangchuan"></i> 上传LOGO</a>
                        <a class="button button-S bg-red" id="dellogo" onclick="delicon(this)" {if !$webdb.weblogo}style="display:none;"{/if}><i class="layui-icon">&#xe67c;</i>删除</a>
                        <input class="ipt" id="weblogo" name="webdb[weblogo]" type="hidden" value="{$webdb.weblogo|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">管理员邮箱</label>
                    </div>
                    <div class="xs8 xl9">
                        <input class="ipt" placeholder="请输入管理员邮箱" name="webdb[webmail]" type="text" value="{$webdb.webmail|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">客服电话</label>
                    </div>
                    <div class="xs8 xl9">
                        <input class="ipt" placeholder="请输入客服电话" name="webdb[webtel]" type="text" value="{$webdb.webtel|default=''}">
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">网站是否关闭</label>
                    </div>
                    <div class="xs8 xl9">
                        <input name="webdb[web_open]" value="1" {eq name="$webdb.web_open" value="1"}checked="checked"{/eq} type="radio" title="开放">
                        <input name="webdb[web_open]" value="0" {eq name="$webdb.web_open" value="0"}checked="checked"{/eq} type="radio" title="关闭">

                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">网站关闭原因</label>
                    </div>
                    <div class="xs8 xl9">
                        <textarea class="ipt" rows="3" name="webdb[open_why]">{$webdb.open_why|default=''}</textarea>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">网站访问地址 <span class="t-red">*</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <input class="ipt" placeholder="请输入网站域名" name="webdb[www_url]" required="" type="text" value="{$webdb.www_url|default=''}">
                        <span class="c-999">格式为：http://www.cxbs.net</span>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">网站风格 <span class="t-red">*</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <select id="dt_type" class="{required:true}" name="webdb[temp]" required>
                            {$temps}
                        </select>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">会员中心风格 <span class="t-red">*</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <select class="{required:true}" name="webdb[user_temp]" required>
                            <option selected="selected" value="defualt">默认风格</option>
                        </select>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">附件目录 <span class="t-red">*</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <input class="ipt" placeholder="请输入附件目录" name="webdb[updir]" required="" type="text" value="{$webdb.updir|default=''}">
                        <span class="c-999">建议不要修改</span>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">ICP备案号 <span class="t-red">*</span></label>
                    </div>
                    <div class="xs8 xl9">
                        <input class="ipt" placeholder="请输入ICP备案号" name="webdb[web_beian]" required="" type="text" value="{$webdb.web_beian|default=''}">
                        <span class="c-999">建议不要修改</span>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">底部版权</label>
                    </div>
                    <div class="xs8 xl9">
                        <textarea class="ipt" rows="3" name="webdb[foot_bq]">{$webdb.foot_bq|default=''}</textarea>
                    </div>
                </div>
                <div class="cx-fex-l mb-10">
                    <div class="x3 t-r">
                        <label class="lab">登录后台是否启用验证码</label>
                    </div>
                    <div class="xs8 xl9">
                        <input name="webdb[web_adminyz]" value="1" {eq name="$webdb.web_adminyz" value="1"}checked="checked"{/eq} type="radio" title="启用">
                        <input name="webdb[web_adminyz]" value="0" {eq name="$webdb.web_adminyz" value="0"}checked="checked"{/eq} type="radio" title="禁用">
                    </div>
                </div>
                <div class="cx-fex-l mb-10 mt-10">
                    <div class="x3 t-r">
                        <label class="lab"></label>
                    </div>
                    <div class="xs8 xl9">
                        <input type="hidden" name="__token__" required lay-verify="required" value="{$Request.token}" />
                        <button class="button bg-blue" lay-submit lay-filter="d-button">立即提交</button>
                    </div>
                </div>
            </form>
        </fieldset>
    </div>
</div>
<div style="height: 20px; overflow: hidden"></div>
{include file="public/js" /}
<script>
    layui.config({
        base: '__ADMIN__/js/'
    }).use('app');
</script>
<script>
    layui.use(['upload','layer'],function () {
        var layupload = layui.upload,
            layer = layui.layer;
        var uplogo = layupload.render({
            elem: '.uploadbtn',
            url:"{:url('Uploads/index')}",
            before: function(obj){
                layer.load();
            },
            done: function(res, index, upload){
                var cx = $(this.item).data();
                layer.closeAll('loading');
                if(res.code != 0){
                    $(cx.err).html('<span style="color: #FF5722;">上传失败</span> <a class="button button-S bg-yellow reload">重试</a>');
                    $(cx.err).find('.reload').on('click', function(){
                        uplogo.upload();
                    });
                    return layer.msg(res.msg,{time: 2000});
                }
                $(cx.imgu).attr('src','/'+ res.src);
                $(cx.vals).val(res.src);
                $(cx.dels).show();
                $(cx.err).hide();
                return layer.msg(res.msg,{time: 2000})
            },
            error: function(){
                var cx = $(this.item).data();
                layer.closeAll('loading');
                $(cx.err).html('<span style="color: #FF5722;">上传失败</span> <a class="button button-S bg-yellow reload">重试</a>');
                $(cx.err).find('.reload').on('click', function(){
                    uplogo.upload();
                });
            }
        });
    })
    function delicon(o) {
        $("#logo-yl").attr('src','');
        $("#weblogo").val('');
        $('#dellogo').hide();
    }
</script>
{include file="public/footer" /}